using Microsoft.AspNetCore.Mvc;

namespace NETCORE.WebApi.Client.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class SerController : ControllerBase
    {

        private readonly string baseUrl = "https://localhost:7057";
        private readonly ClientService clientService;

        public SerController()
        {
            ClientService clientService = new ClientService();
        }

        [HttpGet]
        public async Task<IActionResult> Text()
        { 

            var url = baseUrl + "/api/code/GetCodeStr";
            var parameters = new Dictionary<string, string> { { "code", "123" } };
            var res = await clientService.CallServiceByGet(url, parameters);

            return Ok("done");
        }
    }
}
